package com.njwb.Swing;

import javax.swing.*;
import java.awt.*;

public class ExitPanel extends JPanel {
    public ExitPanel() {
        setLayout(new BorderLayout());
        JLabel label = new JLabel("点击下方按钮退出到登录界面", JLabel.CENTER);
        label.setFont(new Font("宋体", Font.PLAIN, 18));
        add(label, BorderLayout.CENTER);

        JButton exitButton = new JButton("退出登录");
        add(exitButton, BorderLayout.SOUTH);

        // 退出按钮事件，需要在MainFrame中设置ActionListener
    }

    public JButton getExitButton() {
        // 提供给MainFrame添加事件监听器
        return (JButton) this.getComponent(1); // 获取下方按钮
    }
}
